
import React from 'react'
import Header from "../Header"
import ContentNavi from "../ContentNavi"
import UserSettingBody from './UserSettingBody'

import * as ApiMsgAction  from '../../actions/ApiMsgAction';
import { connect }  from 'react-redux';

class UserSettingPanel extends React.Component {


  componentDidUpdate() {
    if (this.props.apiMsg && this.props.apiMsg.length > 0) {
      alert(this.props.apiMsg)
      this.props.dispatch(
        ApiMsgAction.clearApiMsgAction()
      )
    }
  }

  render() {
    return (
      <div className="main-panel" >
        <div className="content" >
          <ContentNavi title="业主管理" />
          <UserSettingBody />
        </div>
      </div>
    )
  }
}

const mapStateToProps = (state, ownProps) => {
  // console.log(state)
  return {
          apiMsg: state.apiMsg
         }
}

export default connect(mapStateToProps)(UserSettingPanel);
